<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../css/mui.min.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">用户管理</h1>
			
			<button type="button" id="butNew" class="mui-btn mui-btn-link  mui-pull-right" style="font-size: 40px;">
				+
			</button>
			<!--
            <button type="button" id="butDel" class="mui-btn mui-btn-link  mui-pull-right" style="font-size: 70px;">
				-
			</button>  -->
		</header>
		
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/tools.js"></script>
		<script type="text/javascript" charset="utf-8">
			 //mui初始化
			mui.init();
			var subpages = ['userlist.html'];
			var subpage_style = {
				top: '45px',
				bottom: '1px'
			};
			
			var aniShow = {};
			
			 //创建子页面，首个选项卡页面显示，其它均隐藏；
			mui.plusReady(function() {
				var self = plus.webview.currentWebview();
				for (var i = 0; i < 1; i++) {
					var temp = {};
					var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
					if (i > 0) {
						sub.hide();
					}else{
						temp[subpages[i]] = "true";
						mui.extend(aniShow,temp);
					}
					self.append(sub);
				}
			});
			 //当前激活选项
			var activeTab = subpages[0];
			var title = document.getElementById("title");
			 //选项卡点击事件
//			mui('.mui-bar-tab').on('tap', 'a', function(e) {
//				var targetTab = this.getAttribute('href');
//				if (targetTab == activeTab) {
//					return;
//				}
//				//更换标题
//				title.innerHTML = this.querySelector('.mui-tab-label').innerHTML;
//				//显示目标选项卡
//				//若为iOS平台或非首次显示，则直接显示
//				if(mui.os.ios||aniShow[targetTab]){
//					plus.webview.show(targetTab);
//				}else{
//					//否则，使用fade-in动画，且保存变量
//					var temp = {};
//					temp[targetTab] = "true";
//					mui.extend(aniShow,temp);
//					plus.webview.show(targetTab,"fade-in",300);
//				}
//				//隐藏当前;
//				plus.webview.hide(activeTab);
//				//更改当前活跃的选项卡
//				activeTab = targetTab;
//			});

	document.getElementById("butNew").addEventListener("tap",function(ev)
	{
		g_jsonData.putData("opMode","new");
		mui.openWindow({
				    url: "newuser.html", 
				    id:"newuser.html"
				  });
	});

			 //自定义事件，模拟点击“首页选项卡”
			document.addEventListener('gohome', function(event) {
				//alert(event.detail.url);

				mui.openWindow({
				    url: event.detail.url, 
				    id:event.detail.url
				  });
				
			});
		</script>
	</body>

</html>

